/*  
 *  Copyright 2006 Paul Jack.
 *
 *  This file is part of the Dex compiler suite. 
 *  
 *  Dex is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at your
 *  option) any later version.
 *  
 *  Dex is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 *  Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
package dex.compiler.problem;


import java.util.List;

import dex.compiler.model.base.Place;
import dex.compiler.model.program.Path;


/**
 * Reports errors or warnings.
 */
public interface Reporter {


	/**
	 * Reports the given omission.
	 * 
	 * @param problem  the omission that occurred
	 * @param place    the place where that omission occurred
	 * @param name     the name of the missing construct
	 */
	void error(Omission problem, Place place, String name);
	
	
	/**
	 * Reports the given ambiguity.
	 * 
	 * @param ambiguity  the ambiguity that occurred
	 * @param place      the place where that ambiguity occurred
	 * @param name       the name of the construct that was defined more than once
	 * @param matches    the list of places where the construct was defined
	 */
	void error(Ambiguity ambiguity, Place place, String name, List<Path> matches);

	
	/**
	 * Reports the given crime.
	 * 
	 * @param problem    the crime that occurred
	 * @param place      the place where that crime occurred 
	 * @param offender   the construct that caused the crime
	 */
	void error(Crime problem, Place place, String offender);
	
	
	/**
	 * Reports the given disagreement.
	 * 
	 * @param problem  the disagreement that occurred
	 * @param place    the place where that disagreement occurred
	 * @param first    the first construct that disagreed
	 * @param second   the second construct that disagreed
	 */
	void error(Disagreement problem, Place place, String first, String second);
	

}
